package com.proj.entity;

// Generated 2014-11-26 14:22:32 by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.proj.annotation.IndexField;

/**
 * Answer generated by hbm2java
 */
@Entity
@Table(name = "answer", catalog = "webhr")
@IndexField(fieldName="table",fieldValue="answer",type=2,indexed=true,stored=true,storeTermVectorOffsets=false,storeTermVectors=false,storeTermVectorPositions=false,tokenized=false)
public class Answer implements java.io.Serializable {

	private String answerId;
	private String question;
	private String userId;
	private String answerContext;
	private Integer commentNum;
	private Date createTime;
	private Integer voteCount;
	private Integer ifAnonymous;
	private Date lastModifyTime;
	@Column(name = "last_modify_time")
	public Date getLastModifyTime() {
		return lastModifyTime;
	}
	public void setLastModifyTime(Date lastModifyTime) {
		this.lastModifyTime = lastModifyTime;
	}
	@Column(name = "if_anonymous")
	public Integer getIfAnonymous() {
		return ifAnonymous;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}


	
	public void setIfAnonymous(Integer ifAnonymous) {
		this.ifAnonymous = ifAnonymous;
	}

	@Column(name = "vote_count")
	public int getVoteCount() {
		return voteCount;
	}

	public void setVoteCount(int voteCount) {
		this.voteCount = voteCount;
	}

	public Answer() {
	}

	public Answer(String answerId, Date createTime) {
		this.answerId = answerId;
		this.createTime = createTime;
	}

	public Answer(String answerId, String question, String userId,
			String answerContext, Integer commentNum, Date createTime) {
		this.answerId = answerId;
		this.question = question;
		this.userId = userId;
		this.answerContext = answerContext;
		this.commentNum = commentNum;
		this.createTime = createTime;
		
	}

	@Id
	@IndexField(fieldName="id",indexed=true,stored=true,storeTermVectorOffsets=false,storeTermVectors=false,storeTermVectorPositions=false,tokenized=false)
	@Column(name = "answer_id", unique = true, nullable = false, length = 50)
	public String getAnswerId() {
		return this.answerId;
	}

	public void setAnswerId(String answerId) {
		this.answerId = answerId;
	}

	@IndexField(fieldName="question_id",indexed=false,stored=true,storeTermVectorOffsets=false,storeTermVectors=false,storeTermVectorPositions=false,tokenized=false)
	@Column(name = "question_id")
	public String getQuestion() {
		return this.question;
	}

	public void setQuestion(String question) {
		this.question = question;
	}

	@Column(name = "user_id", length = 50)
	public String getUserId() {
		return this.userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}
 
	@Column(name = "answer_context", length = 3000)
	@IndexField()
	public String getAnswerContext() {
		return this.answerContext;
	}

	public void setAnswerContext(String answerContext) {
		this.answerContext = answerContext;
	}

	@Column(name = "comment_num")
	public Integer getCommentNum() {
		return this.commentNum;
	}

	public void setCommentNum(Integer commentNum) {
		this.commentNum = commentNum;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_time", length = 19)
	public Date getCreateTime() {
		return this.createTime;
	}


}
